<style scoped>
    .layout-child{
        background: #f5f7f9;
        position: relative;
    }
    .layout-header-bar{
        background: #fff;
        box-shadow: 0 1px 1px rgba(0,0,0,.1);
    }
</style>
<template>
    <div class="layout-child">
        <Sider :style="{position: 'fixed', height: '100vh', left: 0, overflow: 'auto',top: '60px'}">
            <Menu active-name="1-1" width="auto" @on-select="gotoDtsPage" :open-names="['1']">
                <Submenu name="1">
                    <template slot="title">
                        <Icon type="ios-navigate"></Icon>
                        问题单管理
                    </template>
                    <MenuItem name="1-1">总览</MenuItem>
                    <MenuItem name="1-2">问题单详情</MenuItem>
                    <MenuItem name="1-3">统计报告</MenuItem>
                </Submenu>
                <Submenu name="2">
                    <template slot="title">
                        <Icon type="ios-keypad"></Icon>
                        缺陷分析
                    </template>
                    <MenuItem name="2-1">阈值设置</MenuItem>
                    <MenuItem name="2-2">分析结果</MenuItem>
                </Submenu>
            </Menu>
        </Sider>
        <Layout :style="{marginLeft: '200px'}">
            <Content :style="{padding: '0 10px 16px'}">
                <Card dis-hover>
                    <div>
                        <router-view></router-view>
                    </div>
                </Card>
            </Content>
        </Layout>
    </div>
</template>
<script>

    export default {
        created() {
             this.$router.push({ name: '/dts/summary'});
             console.log(config.serverIpAndPort);
        },
        methods: {
            // 跳转至子模块
            gotoDtsPage(pageIndex){
                console.log(pageIndex);
                if(pageIndex == '1-1'){
                    this.$router.push({ name: '/dts/summary'});
                }
                else if(pageIndex == '1-2'){
                    this.$router.push({ name: '/dts/list'});
                }
                
            }
        }
    }
</script>